RoundMenu::Application.routes.draw do
  
  scope ":time/" do
    scope ":town/" do
      match "main.htm" => 'content#main', :as => :main
      match "delivery.htm" => 'content#delivery', :as => :delivery
      match "shares.htm" => 'content#shares', :as => :shares
      match "questions.htm" => 'content#questions', :as => :questions
      match "contacts.htm" => 'content#contacts', :as => :contacts
      match ":desire_id/shops" => "shops#index", :as => :shops
      match ":shop_id/categors" => "categors#index", :as => :categors
      match ":categor_id/products" => "products#index", :as => :products
      match "novations/:id/:keyword" => "novations#show", :as => :novation_show
      match "novations" => "novations#index", :as => :novations
      match "receipts/:id/:keyword" => "receipts#show", :as => :receipt_show
      match "receipts" => "receipts#index", :as => :receipts
      match "cart/show" => "cart#show", :as => :cart_show
      match "contacts/new" => "contacts#new", :as => :new_contact
      match 'login' => "user_sessions#new", :as => :login
      match "user/forget" => "users#forget", :as => :forget
      match "orders/new" => "orders#new", :as => :new_order
      resources :orders, :only => [:new, :create, :index]
    end
  end
  resources :user_sessions, :only => [:create, :destroy]
  match 'logout' => "user_sessions#destroy", :as => :logout
  resources :users, :except => [:index]
  match "users/activate/:login/:code" => "users#activate", :as => :activate
  match "user/recover" => "users#recover", :as => :recover, :via => [:post]
  match "users/reset/:login/:code" => "users#reset", :as => :reset
  match "admin/users/:status" => "users#admin", :as => :user_admin
  resources :banners, :except => [:index, :show]
  resources :qas, :except => [:index, :show]
  resources :receipts, :except => [:show, :index]
  resources :novations, :except => [:show, :index]
  match "moderator/qas/:status" => "qas#moderator", :as => :qa_moderator
  match "moderator/novations/:status" => "novations#moderator", :as => :novation_moderator
  match "moderator/receipts/:status" => "receipts#moderator", :as => :receipt_moderator
  match "moderator/banners/:status" => "banners#moderator", :as => :banner_moderator
  resources :towns, :except => [:index, :show]
  match "admin/towns/:status" => "towns#admin", :as => :town_admin
  resources :desires, :except => [:index, :show]
  match "admin/desires/:status" => "desires#admin", :as => :desire_admin
  resources :shops, :except => [:index, :show]
  match "admin/shops/:status" => "shops#admin", :as => :shop_admin
  resources :staffs, :except => [:index, :show]
  match "admin/staffs/:status" => "staffs#admin", :as => :staff_admin
  resources :categors, :except => [:index, :show]
  match "admin/categors/:status" => "categors#admin", :as => :categor_admin
  resources :products, :except => [:index, :show]
  match "admin/products/:status" => "products#admin", :as => :product_admin
  resources :orders, :except => [:new, :create, :index]
  resources :contacts, :except => [:show, :index, :new]
  match "admin/contacts" => "contacts#admin", :as => :contact_admin
  resources :pageconts, :except => [:show, :index]
  match "moderator/pageconts" => "pageconts#moderator", :as => :pagecont_moderator
  match "order/pay/:id" => "orders#pay", :via => :post, :as => :order_pay
  match "order/submit/:id" => "orders#submit", :via => :post, :as => :order_submit
  match "order/show_admin/:id" => "orders#show_admin", :as => :show_admin_order
  match "order/excel" => "orders#excel", :as => :order_excel
  match "operator/orders" => "orders#operator", :as => :order_operator
  match "cart/add" => "cart#add", :via => [:post], :as => :cart_add
  match "cart/update" => "cart#update", :via => [:put], :as => :cart_update
  match "cart/item/:id" => "cart#delete", :via => :delete, :as => :cart_item
  root :to => "content#main", :time => "day"
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => "welcome#index"

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'
end
